import { browser } from 'webextension-polyfill-ts';

browser.runtime.onMessage.addListener(function (message) {
    if (message.type === 'payStatus') {
        const options = {
            detail: message.data,
        };
        const event = new CustomEvent('payStatus', options);
        window.dispatchEvent(event);
    }
    return Promise.resolve(true);
});
